/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package proyecto.web;


import java.io.IOException;
import java.io.PrintWriter;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.multiaction.MultiActionController;


/** 
 *
 * @author Administrador
 */
public class ofertaLaboralController extends MultiActionController {




    public ofertaLaboralController() {
        //Initialize controller properties here or 
        //in the Web Application Context
        //setCommandClass(MyCommand.class);
        //setCommandName("MyCommandName");
        //setSuccessView("successView");
        //setFormView("formView");

    }

    //@Override
    protected void doSubmitAction(Object command) throws Exception {
        throw new UnsupportedOperationException("Not yet implemented");
    }
    //Use onSubmit instead of doSubmitAction 
    //when you need access to the Request, Response, or BindException objects
    /*
    @Override
    protected ModelAndView onSubmit(
    HttpServletRequest request,
    HttpServletResponse response,
    Object command,
    BindException errors) throws Exception {
    ModelAndView mv = new ModelAndView(getSuccessView());
    //Do something...
    return mv;
    }
     */

    

    public ModelAndView index(HttpServletRequest request, HttpServletResponse response) {
        return new ModelAndView("/postulante_mantener.htm");
    }

   

    

    public ModelAndView doConsultar(HttpServletRequest request, HttpServletResponse response) throws ParseException {
        System.out.println("doConsultar...");

        //Captura las variables pasadas a traves del objeto HttpServletRequest
        String codigo = request.getParameter("codigo");
        String fechaInicial = request.getParameter("fechaInicial");
        String fechaFinal = request.getParameter("txtFechaFinal");
      

        
        try {
            PrintWriter out = response.getWriter();
            out.println("Para esta consulta no existe datos por el momento");
            out.close();
        } catch (IOException ex) {
            Logger.getLogger(ofertaLaboralController.class.getName()).log(Level.SEVERE,
                    null, ex);
        }
        return null;
    }


    public ModelAndView doProcesar(HttpServletRequest request, HttpServletResponse response) throws ParseException {
        System.out.println("doProcesar...");

        //Captura las variables pasadas a traves del objeto HttpServletRequest
        String opcion = request.getParameter("opcion");
        String texto = request.getParameter("texto");
       


        try {
            PrintWriter out = response.getWriter();
            out.println("Para esta consulta no existe datos por el momento");
            out.close();
        } catch (IOException ex) {
            Logger.getLogger(ofertaLaboralController.class.getName()).log(Level.SEVERE,
                    null, ex);
        }
        return null;
    }


}
